package cn.lingyangwl.agile.msg.push.model.rqrs.notice;

import cn.lingyangwl.agile.model.constants.*;
import cn.lingyangwl.agile.model.module.dict.*;
import cn.lingyangwl.agile.msg.push.api.constatnts.*;
import cn.lingyangwl.agile.msg.push.model.entity.MsgNotice.*;
import cn.lingyangwl.framework.validation.group.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Set;

/**
 * 消息模板
 *
 * @author shenguangyang
 */
@Getter
@Setter
public class MsgNoticeBase {
	@NotNull(message = ValidationCons.NOT_EMPTY, groups = UpdateGroup.class)
	private Long id;

	@ApiModelProperty(value = "消息名称")
	private String name;

	@NotEmpty(message = ValidationCons.NOT_EMPTY)
	@ApiModelProperty(value = "通知编码")
	private String code;
	
    @NotNull(message = ValidationCons.NOT_EMPTY)
	@ApiModelProperty(value = "状态, true: 启用, false: 禁用")
	private Boolean status;

	/**
	 * 接收者类型, 如果是会员通知, 则在代码中可以指定任意用户推送, 否则采用绑定的用户
	 * @see MsgCons.ReceiverType
	 */
	@NotEmpty(message = ValidationCons.NOT_EMPTY)
	private String receiverType;

	@ApiModelProperty(value = "消息功能组id")
	@NotNull(message = ValidationCons.NOT_EMPTY)
	private Long groupId;

	/**
	 * @deprecated
	 */
	@ApiModelProperty(value = "模板配置, json格式")
	private String templateConfig;

	@ApiModelProperty(value = "备注")
	private String remark;

	@ApiModelProperty(value = "渠道类型")
	@NotEmpty(message = ValidationCons.NOT_EMPTY)
	@CusFieldBind(type = DictTypeCons.MESSAGE_CHANNEL_TYPE, target = "channelTypeNames")
	protected Set<String> channelTypes;

	@ApiModelProperty(value = "渠道类型")
	protected Set<String> channelTypeNames;

	@ApiModelProperty(value = "消息字段")
	private List<MsgField> msgFields;
}
